import httpUtils from "@/core/utils/http.utils";
// service path
const urls = {
    'getSysDbFilePage': `/api/upms/sysDbFile/page`,
    'getSysDbFileById': `/api/upms/sysDbFile/`,
    'saveSysDbFile': `/api/upms/sysDbFile`,
    'updateSysDbFileById': `/api/upms/sysDbFile`,
    'restoreSysDbFile': `/api/upms/sysDbFile/restore`,// 还原
    'deleteSysDbFileById': `/api/upms/sysDbFile/`,
    'exportExcel': `/api/upms/sysDbFile/exportExcel`,
    'importExcel': `/api/upms/sysDbFile/importExcel`,
};
// service methods
const sysDbFileApi = {
    getSysDbFilePage (param) {
        return httpUtils.get(urls.getSysDbFilePage, param);
    },
    getSysDbFileById(id) {
        return httpUtils.get(urls.getSysDbFileById + id, {});
    },
    saveSysDbFile(param) {
        return httpUtils.postRequest(urls.saveSysDbFile, param);
    },
    updateSysDbFileById(params) {
        return httpUtils.put(urls.updateSysDbFileById, params);
    },
    deleteSysDbFile(id) {
        return httpUtils.delete(urls.deleteSysDbFileById + id);
    },
    restoreSysDbFile(params) {
        return httpUtils.postRequest(urls.restoreSysDbFile, params);
    },
    exportExcel(params){
        return httpUtils.downloadUrlMode(urls.exportExcel,"get", null,params,"zip");
    },
    importExcel(param) {
        return httpUtils.postRequest(urls.importExcel, param);
    },

};

export default sysDbFileApi;
